<?php

class Corner_image_Model extends ORM {

	

	protected $table_name = 'corner_images';

	protected $primary_key = 'corner_image_id';

	protected $col_sort_order = 'corner_order';

	
		

	public function get($id='')

	{

		if(!empty($id))
		$this->db->where('corner_id',$id);
		$this->db->from($this->table_name);

		$this->db->select('*');

		
		$this->db->orderby($this->primary_key,'desc');

		$query = $this->db->get();

		return $query->result_array(false);

		

	}
	public function get_with_active()

	{

		$this->db->select('*');

		$this->db->from($this->table_name);

		$this->db->join('corner', 'corner_images.corner_id', 'corner.corner_id');
		
		$this->db->where('corner.corner_status','1');

		
		$query = $this->db->get();

		return $query->result_array(false);

		

	}

}

?>